﻿{% extends "super.html" %}
{% block title %}员工管理{% endblock %}
{% block s1 %}active{% endblock %}
{% block titlehref %}index{% endblock %}
{% block titlename %}全局动态{% endblock %}
{% block subtitlehref %}{% endblock %}
{% block subtitlename %}员工管理{% endblock %}
{% block content %}
<script type="text/javascript" src="static/myjs/email.js"></script>
<section id="main-content">
	<section class="wrapper site-min-height">
		<div class="btn-row">
			<div class="btn-group" data-toggle="buttons">
				<button id="sh1" class="btn btn-primary">未审核申请邮件</button>
				<button id="sh2" class="btn btn-default">已审核申请邮件</button>
			</div>
		</div>

		<!-- BEGIN ROW  -->
		<div class="row" id="t1">
			<div class="col-lg-12">
				<section class="panel">
					<header class="panel-heading">
						<button class="btn btn-success" disabled>申请列表</button>
					</header>
					<div class="panel-body">
						<div class="adv-table">
							<table class="display table table-bordered table-striped" id="example1">
								<thead>
								<tr>
									<th>标题</th>
									<th>内容</th>
									<th>申请人ID</th>
									<th>申请人姓名</th>
									<th>申请日期</th>
									<th>操作</th>
								</tr>
								</thead>
								<tbody>
								{%for i in list%}
								<tr>
									<td>
										{%if i.Type == 1%}
										<span class="label label-success">事假</span>
										{%endif%}
										{%if i.Type == 2%}
										<span class="label label-danger">病假</span>
										{%endif%}
										{%if i.Type == 3%}
										<span class="label label-warning">婚假</span>
										{%endif%}
										{%if i.Type == 4%}
										<span class="label label-warning">工伤假</span>
										{%endif%}
										{%if i.Type == 5%}
										<span class="label label-warning">丧假</span>
										{%endif%}
									</td>
									<td style="width: 30%">{{i.Content}}</td>
									<td style="width: 10%">{{i.Sid}}</td>
									<td style="width: 10%">{{i.Sname}}</td>
									<td style="width: 15%">{{i.Create_time}}</td>
									<td style="width: 20%">
										<button onclick="ChangeStatus('{{i.Id}}',1)" class="btn-success">同意</button>
										<button onclick="ChangeStatus('{{i.Id}}',2)" class="btn-primary">拒绝</button>
										<button onclick="DeleteEmail({{i.Id}})" class="btn-danger">删除</button>
									</td>
								</tr>
								{%endfor%}
								</tbody>
								<tfoot>
								<tr>
									<th>标题</th>
									<th>内容</th>
									<th>申请人ID</th>
									<th>申请人姓名</th>
									<th>申请日期</th>
									<th>操作</th>
								</tr>
								</tfoot>
							</table>
						</div>
					</div>
				</section>
			</div>
		</div>
		<div class="row" hidden id="t2">
			<div class="col-lg-12">
				<section class="panel">
					<header class="panel-heading">
						<button class="btn btn-success" disabled>已处理申请列表</button>
					</header>
					<div class="panel-body">
						<div class="adv-table">
							<table class="display table table-bordered table-striped" id="example2">
								<thead>
								<tr>
									<th>标题</th>
									<th>内容</th>
									<th>申请人ID</th>
									<th>申请人姓名</th>
									<th>申请日期</th>
									<th>状态</th>
									<th>操作</th>
								</tr>
								</thead>
								<tbody>
								{%for i in list2%}
								<tr>
									<td>
										{%if i.Type == 1%}
										<span class="label label-success">事假</span>
										{%endif%}
										{%if i.Type == 2%}
										<span class="label label-danger">病假</span>
										{%endif%}
										{%if i.Type == 3%}
										<span class="label label-warning">婚假</span>
										{%endif%}
										{%if i.Type == 4%}
										<span class="label label-warning">工伤假</span>
										{%endif%}
										{%if i.Type == 5%}
										<span class="label label-warning">丧假</span>
										{%endif%}
									</td>
									<td style="width: 30%">{{i.Content}}</td>
									<td style="width: 10%">{{i.Sid}}</td>
									<td style="width: 10%">{{i.Sname}}</td>
									<td style="width: 15%">{{i.Create_time}}</td>
									<td style="width: 8%">
										{%if i.Result == 1%}
										<span class="label label-success">已同意</span>
										{%else%}
										<span class="label label-danger">已拒绝</span>
										{%endif%}
									</td>
									<td style="width: 10%">
										<button onclick="DeleteEmail({{i.Id}})" class="btn-danger">删除</button>
									</td>
								</tr>
								{%endfor%}
								</tbody>
								<tfoot>
								<tr>
									<th>标题</th>
									<th>内容</th>
									<th>申请人ID</th>
									<th>申请人姓名</th>
									<th>申请日期</th>
									<th>状态</th>
									<th>操作</th>
								</tr>
								</tfoot>
							</table>
						</div>
					</div>
				</section>
			</div>
		</div>

		<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"
		     aria-hidden="true">
			<div class="modal-dialog">
				<div class="modal-content">
					<div class="modal-header">
						<button type="button" class="close" data-dismiss="modal" aria-hidden="true">
							&times;
						</button>
						<h4 class="modal-title" id="myModalLabel">
							编辑职工信息
						</h4>
					</div>
					<div class="modal-body">
						<form id="updatenews" action="staff" method="post">
							<div class="panel-body">
								<input id="id" name="id" hidden>
								<input id="type" name="type" hidden>
								<input id="sex" name="sex" hidden>
								<input id="option" name="option" hidden>
								<div class="form-group">
									<label for="exampleInputPassword1">姓名</label>
									<input type="text" class="form-control" id="username" name="username"
									       placeholder="请输入姓名">
								</div>
								<div class="form-group">
									<label for="exampleInputPassword1">密码</label>
									<input type="password" class="form-control" id="password" name="password"
									       placeholder="请输入6~20位密码">
								</div>
								<div class="form-group">
									<label for="exampleInputPassword1">身份证</label>
									<input type="number" class="form-control" id="ident" name="ident"
									       placeholder="请输入18位身份证">
								</div>
								<div class="form-group">
									<label for="exampleInputPassword1">电话</label>
									<input type="number" class="form-control" id="phone" name="phone"
									       placeholder="请输入7~11位电话号码">
								</div>
								<div class="form-group">
									<p class="text-muted">
										性别
									</p>
									<div class="btn-group" data-toggle="buttons">
										<label class="btn btn-default active">
											<input class="sex" type="radio" id="option1" checked>
											男
										</label>
										<label class="btn btn-default">
											<input class="sex" type="radio" id="option2">
											女
										</label>
									</div>
								</div>
								<div class="form-group">
									<p class="text-muted">
										职称
									</p>
									<div class="btn-group" data-toggle="buttons">
										<label class="btn btn-default active">
											<input class="type" type="radio" id="option3" checked>
											教师
										</label>
										<label class="btn btn-default">
											<input class="type" type="radio" id="option4">
											劳务工
										</label>
									</div>
								</div>
								<div class="form-group">
									<label for="exampleInputPassword1">薪资</label>
									<input type="number" class="form-control" id="reap" name="reap"
									       placeholder="请输入职工薪资">
								</div>
							</div>
						</form>

					</div>
					<div class="modal-footer">
						<button type="button" class="btn btn-default" data-dismiss="modal">关闭
						</button>
						<button id="update" type="button" class="btn btn-primary">
							提交更改
						</button>
					</div>
				</div><!-- /.modal-content -->
			</div><!-- /.modal -->
		</div>
		<!-- END ROW  -->
	</section>
</section>

<script>
    <!-- DATATABLE JS  -->
    $(document).ready(function () {
        $('#example1').dataTable({
            "aaSorting": [[4, "desc"]]
        });
        $('#example2').dataTable({
            "aaSorting": [[4, "desc"]]
        });
    });
</script>
{% endblock%}